Component({
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [
      {
        "pagePath": "/pages/index/index",
        "text": "首页",
        "iconPath": "/icon/index (1).png",
        "selectedIconPath": "/icon/index.png"
    },
        {
        "selectedIconPath": "/icon/data.png",  
        "iconPath": "/icon/data (2).png", 
        "pagePath": "/pages/data1/data1",  
        "text": "数据查看"  
      },
      {
        "selectedIconPath": "/icon/alarm.png",  
        "iconPath": "/icon/alarm (2).png", 
        "pagePath": "/pages/alarm/alarm",  
        "text": "噪音警报"  
      }
    ]
  },
  attached() {
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})